//更新数据库表中姓名为nuo 用户id为7的用户的年龄为25
//npm install mysql
const mysql = require("mysql");

//创建数据库连接
let con = mysql.createConnection({
    host: "192.168.174.166",
    user: "root",
    password: "ddd",
    database: "informationsys"
})
let userAge = '25';
let sql = "update users set user_age=? where user_name='nuo' and user_id=7";

con.query(sql, [userAge], (err, results, fields) => {
    if (err) {
        console.log(err)
    }
    else {
        console.log(results)
    }
})